home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / util / boot / BlizKick.lha / BlizKick / Modules / FixGetMsg.ASM < prev    next >
Assembly Source File  |  2000-09-04  |  2KB  |  96 lines

  1. ; FILE: Source:modules/FixGetMsg.ASM          REV: 1 --- Fix GetMsg() bug
  2.  
  3. ;
  4. ; FixGetMsg - Fix 68060 GetMsg() loop hang
  5. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. ; Written by Harry "Piru" Sintonen.
  7. ; This source code is Public Domain.
  8. ; Idea stolen from FixGetMsg by Frederick H. G. Wright II <fw@well.com>.
  9. ;
  10. ; This module fixes the hang if GetMsg() is called in tight loop
  11. ; on 68060. This new version is also marginally faster than the
  12. ; original rom function.
  13. ;
  14. ;    - Piru
  15. ;
  16.  
  17.     incdir    "include:"
  18.     include    "exec/ports.i"
  19.     include    "exec/execbase.i"
  20.  
  21.     include    "exec/exec_lib.i"
  22.  
  23.     include    "blizkickmodule.i"
  24.  
  25.  
  26.     SECTION    MODULE,CODE
  27. _DUMMY_LABEL
  28.  BK_MOD BKMF_SingleMode,_end,(RTF_COLDSTART)<<24+37<<16+NT_UNKNOWN<<8+104,_name,_idstr,_init
  29.  
  30. ; Singlemode on,
  31. ; COLDSTART module, requires KS V37.x or better, module type NT_UNKNOWN, priority 103.
  32.  
  33. _init    movem.l    d0-d1/a0-a1/a6,-(sp)
  34.     move.l    (4).w,a6
  35.  
  36.     lea    (newGetMsg,pc),a0
  37.     move.l    a0,d0
  38.     move.w    #_LVOGetMsg,a0
  39.     move.l    a6,a1
  40.     jsr    (_LVOForbid,a6)
  41.     jsr    (_LVOSetFunction,a6)
  42.     jsr    (_LVOPermit,a6)
  43.  
  44.     movem.l    (sp)+,d0-d1/a0-a1/a6
  45.     rts
  46.  
  47.     CNOP    0,4
  48. newGetMsg
  49.     lea    (MP_MSGLIST,a0),a0
  50.     moveq    #0,d0
  51.     cmp.l    (LH_TAIL+LN_PRED,a0),a0
  52.     beq.b    .exit
  53.  
  54.     lea    $DFF09A,a1
  55.     move.w    #$4000,(a1)
  56.     addq.b    #1,(IDNestCnt,a6)
  57.     move.l    (a0),d0
  58.     move.l    ([a0]),(a0)
  59.     move.l    a0,([a0],LN_PRED)
  60.     subq.b    #1,(IDNestCnt,a6)
  61.     bge.b    .exit
  62.     move.w    #$C000,(a1)
  63. .exit    rts
  64.  
  65.  
  66. ; here is the original function:
  67.  
  68.     IFGT    0
  69.  
  70. _LVOGetMsg
  71.     lea    (MP_MSGLIST,a0),a0
  72.     move.w    #$4000,$DFF09A
  73.     addq.b    #1,(IDNestCnt,a6)
  74.     move.l    (a0),a1
  75.     move.l    (a1),d0
  76.     beq.b    .exit2
  77.     move.l    d0,(a0)
  78.     exg    d0,a1
  79.     move.l    a0,(LN_PRED,a1)
  80. .exit2    subq.b    #1,(IDNestCnt,a6)
  81.     bge.b    .exit
  82.     move.w    #$C000,$DFF09A
  83. .exit    rts
  84.  
  85.     ENDC
  86.  
  87. _name    dc.b    'FixGetMsg',0
  88. _idstr    dc.b    'FixGetMsg 1.0 (27.3.00)',0
  89.     CNOP    0,2
  90. _end
  91.  
  92.     SECTION    VERSION,DATA
  93.  
  94.     dc.b    '$VER: FixGetMsg_MODULE 1.0 (27.3.00)',0
  95.  
  96.